With the advent and explosion of the Internet, a number of technologies that facilitate the interchange of data have become widely utilized. One of these technologies, extensible markup language (“XML”), has become a foundational building block which makes possible a wide variety of different types of document processing and exchange. For instance, XML can be used to encapsulate any kind of structured information in order to pass the information between computing systems that would otherwise be unable to communicate.
In order to facilitate the creation and editing of documents containing XML, and other markup languages, software tools have been created or adapted to provide XML editing features. In particular, some word processing applications (“word processors”) have been adapted to allow an XML schema to be attached to a word processing document. Once the XML schema has been attached, XML tags may be added to the data contained in the word processing document.
Many word processors also include functionality for comparing two electronic documents. During the compare process, the contents of a source document and a destination document are compared to identify the matching portions and the differing portions of the two documents. The contents of the source document are then merged into the destination document based upon the matching and differing portions. Optionally, the differing portions of the source document may be marked as revisions in terms of content inserted and content deleted. Based upon the results, a user can quickly determine the similarities and differences between two documents or versions of the same document.
Problems can occur when a word processor supports both the addition and editing of XML markup within an electronic document and comparing and merging two documents. These problems result from the fact that XML markup existing in a document must always follow certain structural and syntactical rules, called XML well formedness rules, to be considered valid. For instance, an XML start tag must always have a matching XML end tag and XML elements must be properly nested within one another and cannot overlap. If two documents containing XML markup were merged without regard to these restrictions, the XML markup in the resulting document could not be considered well formed XML, as it would be essentially corrupt. As a result, the word processor would not be able to save such a merged document as valid XML.
One obvious way to merge two documents to preserve XML well formedness is to simply append one document to the other document. However, this method is not very useful to a user because, although the well formedness of the XML is preserved, this method does not accomplish the goal of comparing the documents. Merging is valuable to a user because the documents are not just merged, but also compared, so that the contents that are the same do not have to be repeated in the merged document, while contents that are different can be highlighted to the user as being different and treated as insertions or deletions.
It is with respect to these considerations and others that the various embodiments of the present invention have been made.